A database is a collection of stored data that is logically related and that is accessible by one or more users or applications. A popular type of database is the relational database management system (RDBMS), which includes relational tables, also referred to as relations, made up of rows and columns (also referred to as tuples and attributes). Each row represents an occurrence of an entity defined by a table, with an entity being a person, place, thing, or other object about which the table contains information.
One of the goals of a database management system is to optimize the performance of queries for access and manipulation of data stored in the database. Given a target environment, an optimal query plan is selected, with the optimal query plan being the one with the lowest cost (e.g., response time) as determined by an optimizer. The response time is the amount of time it takes to complete the execution of a query on a given system.
In massively parallel processing (MPP) systems, the processing costs for performing parallel joins can become undesirable. As is understood, a join comprises a structured query language (SQL) operation that combines records from two or more tables. Efficient parallel joins are critical to the performance of parallel database systems.
A relation may be divided among a plurality of processing modules in the MPP system. Such a mechanism is referred to herein as partitioning. Typically, a relation is partitioned on a primary index by hashing the rows on the primary index and distributing the rows to a particular processing module based on the primary index hash value as described more fully hereinbelow. Assuming that the join operation includes predicates that do no include the primary index on which the relations are partitioned, redistribution and/or duplication of the tables is required to complete the join operation such that rows from the relations that match on the join predicate(s) are located at common processing modules. In the event that the tables are significantly large, the redistribution or duplication costs may become undesirably excessive.